#ifndef CPURANKITEMDELEGATE_H
#define CPURANKITEMDELEGATE_H

#include <QAbstractItemDelegate>

class CpuRankItem;

class CpuRankItemDelegate : public QAbstractItemDelegate
{
    Q_OBJECT
public:
    explicit CpuRankItemDelegate(QObject *parent = nullptr);

signals:
    void switchIdChagned(const QString &id, bool switched);

    // QAbstractItemDelegate interface
public:
    void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const override;
    QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const override;
    bool editorEvent(QEvent *event, QAbstractItemModel *model, const QStyleOptionViewItem &option, const QModelIndex &index) override;

private:
    mutable QScopedPointer<CpuRankItem> m_itemWidget;

};

#endif // CPURANKITEMDELEGATE_H
